# Maintainer: Willow Barraco <contact@willowbarraco.fr>
pkgname=py3-tidalapi
pkgver=0.7.4
pkgrel=1
pkgdesc="Unofficial Python API for TIDAL music streaming service"
url="https://pypi.org/project/tidalapi/"
arch="noarch"
license="LGPL-3.0-or-later"
depends="python3 py3-requests py3-dateutil"
makedepends="py3-gpep517 py3-wheel py3-installer py3-poetry-core"
checkdepends="py3-pytest py3-keyring py3-ffmpeg py3-pillow"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/tamland/python-tidal/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/python-tidal-$pkgver"
options="!check" # Visit https://link.tidal.com/... to log in

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
eb95a3c371bfda1e570e1e8751e80891833c8cece81770f5d77a27913a39c21bf010ced03b2372c70f00f729d98cd8378328a3fae7d466d721352273f3d80f0c  py3-tidalapi-0.7.4.tar.gz
"
